﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="userProfile.aspx.vb" Inherits="customtech.userProfile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
        <h1>
   
        USER PROFILE</h1>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" 
            AutoGenerateRows="False" CssClass="detailpage" DataSourceID="SqlDataSource1" 
            Height="50px" Width="125px">

            <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
            <Fields>
                <asp:ImageField DataImageUrlField="UserPic" HeaderText="Profile picture">
                    <ControlStyle CssClass="detailPicture" />
                </asp:ImageField>
                <asp:BoundField DataField="FirstName" HeaderText="First Name" 
                    SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="Last Name" 
                    SortExpression="LastName" />
                <asp:BoundField DataField="Gender" HeaderText="Gender" 
                    SortExpression="Gender" />
                <asp:BoundField DataField="DoB" HeaderText="DoB" SortExpression="DoB" />
                <asp:BoundField DataField="PreferredOS" HeaderText="Preferred OS" 
                    SortExpression="PreferredOS" />
                <asp:BoundField DataField="PreferredCPU" HeaderText="Preferred CPU" 
                    SortExpression="PreferredCPU" />
                <asp:BoundField DataField="PreferredScreenResolution" 
                    HeaderText="Preferred Screen Resolution" 
                    SortExpression="PreferredScreenResolution" />
                <asp:BoundField DataField="DateRegistered" HeaderText="Date Registered" 
                    SortExpression="DateRegistered" />
                <asp:BoundField DataField="CountOfBuildName" HeaderText="Builds by user" 
                    SortExpression="CountOfBuildName" />
                <asp:BoundField DataField="commentcount_CountOfID" 
                    HeaderText="Comments by user" SortExpression="commentcount_CountOfID" />
                <asp:BoundField DataField="tagsaddedby_CountOfID" 
                    HeaderText="Tags by user" SortExpression="tagsaddedby_CountOfID" />
            </Fields>
        </asp:DetailsView>
        <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connstr %>" 
        ProviderName="<%$ ConnectionStrings:connstr.ProviderName %>" 
        
            SelectCommand="SELECT [FirstName], [LastName], [Gender], [DoB], [PreferredOS], [PreferredCPU], [PreferredScreenResolution], [DateRegistered], [CountOfBuildName], [commentcount_CountOfID], [tagsaddedby_CountOfID], [UserPic] FROM [profileview] WHERE ([UserName] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
        <h1>
            Builds Posted by user </h1>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CssClass="gridtable" DataSourceID="SqlDataSource2">

                <Columns>
                    <asp:HyperLinkField DataNavigateUrlFields="ID" 
                        DataNavigateUrlFormatString="details.aspx?ID={0}" DataTextField="BuildName" />
                    <asp:BoundField DataField="CPU" HeaderText="CPU" 
                        SortExpression="CPU" />
                    <asp:BoundField DataField="Motherboard" HeaderText="Motherboard" 
                        SortExpression="Motherboard" />
                    <asp:BoundField DataField="RAM" HeaderText="RAM" 
                        SortExpression="RAM" />
                    <asp:BoundField DataField="Graphics" HeaderText="Graphics" 
                        SortExpression="Graphics" />
                    <asp:BoundField DataField="HardDrive" HeaderText="Hard Drive" 
                        SortExpression="HardDrive" />
                    <asp:BoundField DataField="Power" HeaderText="Power" 
                        SortExpression="Power" />
                    <asp:BoundField DataField="Casing" HeaderText="Casing" 
                        SortExpression="Casing" />
                    <asp:BoundField DataField="Audio" HeaderText="Audio" 
                        SortExpression="Audio" />
                    <asp:BoundField DataField="Mouse" HeaderText="Mouse" SortExpression="Mouse" />
                    <asp:BoundField DataField="Keyboard" HeaderText="Keyboard" 
                        SortExpression="Keyboard" />
                    <asp:BoundField DataField="Monitor" HeaderText="Monitor" 
                        SortExpression="Monitor" />
                    <asp:BoundField DataField="TotalCostToBuild" HeaderText="Total Cost To Build" 
                        SortExpression="TotalCostToBuild" />
                </Columns>
            </asp:GridView>
       
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:connstr %>" 
            ProviderName="<%$ ConnectionStrings:connstr.ProviderName %>" 
            SelectCommand="SELECT [ID], [BuildName], [BuildPicture], [TotalCostToBuild], [UserName], [DateAdded], [AverageRating], [CountOfID], [Description], [CPU], [Motherboard], [RAM], [Graphics], [HardDrive], [Power], [Casing], [Audio], [Mouse], [Keyboard], [Monitor] FROM [Builds Query1] WHERE ([UserName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
       
</asp:Content>
